Day Of Week Type
Represents the days of the week using a bitmask pattern.
Each day of the week is assigned a unique bit value (powers of 2), allowing combinations of days to be represented as a single long
value. This is useful for configurations where multiple days can be selected, such as scheduling content playback or setting operational hours.
The getDaysOfWeek method can be used to convert a combined bitmask value back into an EnumSet of DayOfWeekType
enums. To create a bitmask from a set of enums, you would typically iterate over the desired DayOfWeekType
instances and bitwise OR their getValue results.
Example of creating a bitmask for Monday and Wednesday:
long mondayAndWednesday = DayOfWeekType.MONDAY.getValue() | DayOfWeekType.WEDNESDAY.getValue();
EnumSet<DayOfWeekType> days = DayOfWeekType.getDaysOfWeek(mondayAndWednesday);
// days will contain MONDAY and WEDNESDAY
See also
Properties
Functions
DayOfWeekType
enums.Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.